
   
function ConnectedPiece (startX, startY, x, y, color) {
  this.init(startX, startY, x, y, color);
  this.connections = [[],[],[],[]];
  /*
  this.connections[TOP] = new Array();
  this.connections[BOTTOM] = new Array();
  this.connections[LEFT] = new Array();
  this.connections[RIGHT] = new Array();
  */
}

ConnectedPiece.prototype = Piece.prototype;

toTest.push(ConnectedPiece);


ConnectedPiece.prototype.test = function() {
  var a = ONE;
  var mine = new ConnectedPiece(ONE, ONE, a, a.half(), WHITE);
  var others = new Array();
  // 
  //
  //  |     |     |  |   <- others
  //     |           |   <- mine
  
  others.push(new ConnectedPiece(ONE.subtract(a.half().half()), ONE.subtract(a.half().half()), a.half(), a.half().half(), BLACK));
  others.push(new ConnectedPiece(ONE.add(a.half().half()), ONE.subtract(a), a.half(), a, BLACK));
  others.push(new ConnectedPiece(ONE.add(a).subtract(a.half().half()), ONE.subtract(a.half()), a.half().half(), a.half(), WHITE));
  mine.connections[TOP] = others;
  assert(mine.connections[TOP][0].x.equals(a.half()));
  assert(mine.connections[TOP][1].x.equals(a.half()));
  assert(mine.connections[TOP][2].x.equals(a.half().half())); 
};
